import find_mxnet
import mxnet as mx

data_dir = "/home/spark/32data"
data_shape =(1, 32, 32)
batch_size = 1

train = mx.io.ImageRecordIter(
            path_imgrec=data_dir + "/data_train.rec",
            mean_img=data_dir + "/mean.bin",
            rand_crop=True,
            rand_mirror=True,
            data_shape=data_shape,
            batch_size=batch_size,
            preprocess_threads=1,
            num_parts=1,
            part_index=0)
            #part_sync=bili)
n = 1
for data_batch in train:
    n = n+1

print n